package com.yylc.cscore.dao;

import com.yylc.cscore.entity.UserBasicDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author xiangnan
 */
@Mapper
public interface UserBasicDataDao {

    @Select("select * from hn_call_user_basic_data where user_id = #{userId}")
    UserBasicDataEntity selectByUserId(@Param("userId") String userId);

    /**
     * 获取渠道信息列表（注册渠道、下载渠道）
     */
    List<String> getRegisterFromNameList(@Param("serviceId") String serviceId);
    List<String> getRegisterDeviceFromNameList(@Param("serviceId") String serviceId);

    /**
     * 获取所有待分配的用户列表
     */
    @Select("select a.* from hn_call_user_basic_data a " +
            "left join hn_call_user_match_service_relation b on a.user_id = b.user_id " +
            "where b.user_id is null")
    List<UserBasicDataEntity> selectListWillAlloct();

}
